# Maintainer: Daniel M. Capella <polyzen@archlinux.org>

pkgname=xandikos
pkgver=0.2.8
pkgrel=3
pkgdesc='Lightweight yet complete CardDAV/CalDAV server that backs onto a Git repository'
arch=('any')
url=https://www.xandikos.org
license=('GPL3')
depends=('python-aiohttp' 'python-defusedxml' 'python-dulwich'
         'python-icalendar' 'python-jinja' 'python-multidict')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
optdepends=('python-aiohttp-openmetrics: for metrics with the standalone server'
            'uwsgi-plugin-python: for the WSGI interface')
source=("https://files.pythonhosted.org/packages/source/x/xandikos/xandikos-$pkgver.tar.gz")
sha256sums=('16f174f75d0b4a766f9a41e2fe2700e5d77e77d9a9990cee3d619dc1d8aff001')
b2sums=('9e4ac9eb668bddcf186c35e2927f079887388e42dc269d9be4999a479fe8f4bcf42b383e2d155cd5b70e0f5b2c7c08cb4d8313ee0583eca7297661a89462f82e')

build() {
  cd xandikos-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd xandikos-$pkgver
  python -m unittest xandikos.tests.test_suite
}

package() {
  cd xandikos-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 -t "$pkgdir"/usr/share/doc/xandikos README.rst
  install -Dm644 -t "$pkgdir"/usr/share/doc/xandikos/examples examples/*
  #install -Dm644 -t "$pkgdir"/usr/share/man/man8 man/xandikos.8
}
